<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
	
	<head>
		<meta charset="utf-8" />
		<title>后台管理系统</title>

		<meta name="description" content="data tables" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="shortcut icon" href="/Public/assets/img/favicon.png" type="image/x-icon">

		<!--Basic Styles-->
		<link href="/Public/assets/css/bootstrap.min.css" rel="stylesheet" />
		<link id="bootstrap-rtl-link" href="#" rel="stylesheet" />
		<link href="/Public/assets/css/font-awesome.min.css" rel="stylesheet" />
		<link href="/Public/assets/css/weather-icons.min.css" rel="stylesheet" />
		<link href="/Public/assets/css/ladda-themeless.min.css" rel="stylesheet" />

		<!--Fonts-->

		<!--Beyond styles-->
		<link id="beyond-link" href="/Public/assets/css/beyond.min.css" rel="stylesheet" />
		<link href="/Public/assets/css/demo.min.css" rel="stylesheet" />
		<link href="/Public/assets/css/typicons.min.css" rel="stylesheet" />
		<link href="/Public/assets/css/animate.min.css" rel="stylesheet" />
		<link href="/Public/assets/css/dataTables.bootstrap.css" rel="stylesheet" />
		<style type="text/css">
			.page-content {
				margin-left: 0;
			}
		</style>
		<script src="/Public/assets/js/jquery.min.js"></script>
		
		
	</head>
	<!-- /Head -->
	<!-- Body -->

	<body>
		
		
		
     <div class="login-container animated fadeInDown">
        <div class="loginbox bg-white">
        	<form id="loginForm" method="post">
            <div class="loginbox-title">Login</div>
            <div class="loginbox-social">
                <div class="social-title "></div>
                
            </div>
           
            <div class="loginbox-textbox">
                <input type="text" class="form-control" name="username" id="username" placeholder="登录名" />
            </div>
            <div class="loginbox-textbox">
                <input type="password" class="form-control" name="password" id="password" placeholder="密码" />
            </div>
             <div class="loginbox-textbox clearfix">
                <input type="text" class="form-control" name="verify" id="verify" placeholder="验证码" style="width: 100px; float: left; border-radius: 5px;" />
                <img title="点击刷新验证码" src="<?php echo U('Captcha/show');?>" style="width: 110px; height: 34px; float: right;" onclick="this.src='<?php echo U('Captcha/show');?>'+'#'+Math.random()">
            </div>
            
            <div class="loginbox-submit">
                <input type="submit" class="btn btn-primary btn-block" value="登陆">
            </div>
            </form>
        </div>
       
    </div>


				<!--Basic Scripts-->
		
		<script src="/Public/assets/js/bootstrap.min.js"></script>
		<script src="/Public/assets/js/slimscroll/jquery.slimscroll.min.js"></script>
		<script src="/Public/assets/js/fuelux/spinbox/fuelux.spinbox.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/Public/assets/js/loading/spin.js" type="text/javascript" charset="utf-8"></script>
		<script src="/Public/assets/js/loading/ladda.js" type="text/javascript" charset="utf-8"></script>
		<script src="/Public//assets/js/bootstrap-modalmanager.js" type="text/javascript" charset="utf-8"></script>
		<!--Beyond Scripts-->
		<script src="/Public/assets/js/beyond.js"></script>
		<script src="/Public/assets/js/toastr/toastr.js"></script>
		<script src="/Public/assets/js/bootbox/bootbox.js"></script>
		<script src="/Public/assets/js/common.js"></script>
		
<script src="/Public/assets/js/jquery.form.js" type="text/javascript" charset="utf-8"></script>
	
	<script type="text/javascript">
		if(window.top != window.self){ 
			window.top.location.href = location.href;
		}
		$("#loginForm").submit(function(e){
			e.preventDefault();
			var username = $("#username").val();
			var password = $("#password").val();
			var verify = $("#verify").val();
			if(!username){
				bootbox.alert("<h4 class='danger'>登录名不能为空</h4>");
				return false;
			}
			if(!password){
				bootbox.alert("<h4 class='danger'>登陆密码不能为空</h4>");
				return false;
			}
			if(!verify){
				bootbox.alert("<h4 class='danger'>验证码不能为空</h4>");
				return false;
			}
			$("#loginForm").ajaxSubmit(function(result){
				result = JSON.parse(result);
				if(result.status == 'success'){ 
					location.href = '<?php echo U('index/index');?>';
				}else{ 
					bootbox.alert("<h4 class='danger'>"+result.message+"</h4>");
					if(result.hasOwnProperty('code') && parseInt(result.code) == 99){ 
						$("#verify").val('').siblings("img").trigger("click");
					}
					return false;
				}
			});
		})
	</script>


	</body>
	<!--  /Body -->
	<script>
		 <?php if (!IS_AJAX) { $success_message = session('__SUCCESS_MESSAGE'); if ($success_message) { echo "tips('".$success_message. "');"; } session('__SUCCESS_MESSAGE', null); $error_message = session('__ERROR_MESSAGE'); if ($error_message) { echo "tips('".$error_message. "','danger');"; } session('__ERROR_MESSAGE', null); } ?>
	
	if(parent && typeof parent._attachEvent == 'function'){
		parent._attachEvent(document.documentElement, 'keydown', parent.resetF5);
	}
	</script>

</html>